package com.metaera.app.data.model;

import java.util.List;

public class InformationDetailsResponse {


    private int             id;
    private int             author_id;
    private String          ticket_id;
    private String          title;
    private String          illustrate;
    private int             language;
    private int             is_collection;
    private String          pic;
    private String          content;
    private int             visits_num;
    private Object          start_time;
    private Object          end_time;
    private Object          create_date;
    private int             like_num;
    private int             deny_num;
    private String          release_time;
    private int             score;
    private int             is_like;
    private int             is_deny;
    private int             release_time_stamp;
    private Author          author;
    private List<LabelInfo> label_info;
    private SpecialInfo     special_info;

    private int is_follow;

    public int getIs_collection() {
        return is_collection;
    }

    public void setIs_collection(int is_collection) {
        this.is_collection = is_collection;
    }

    public SpecialInfo getSpecial_info() {
        return special_info;
    }

    public void setSpecial_info(SpecialInfo special_info) {
        this.special_info = special_info;
    }

    public int getIs_follow() {
        return is_follow;
    }

    public void setIs_follow(int is_follow) {
        this.is_follow = is_follow;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getAuthor_id() {
        return author_id;
    }

    public void setAuthor_id(int author_id) {
        this.author_id = author_id;
    }

    public String getTicket_id() {
        return ticket_id;
    }

    public void setTicket_id(String ticket_id) {
        this.ticket_id = ticket_id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getIllustrate() {
        if (illustrate == null){
            return "";
        }

        return (illustrate.length() > 25 ? illustrate.substring(0, 25) : illustrate) + "...";
    }

    public void setIllustrate(String illustrate) {
        this.illustrate = illustrate;
    }

    public int getLanguage() {
        return language;
    }

    public void setLanguage(int language) {
        this.language = language;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getVisits_num() {
        return visits_num;
    }

    public void setVisits_num(int visits_num) {
        this.visits_num = visits_num;
    }

    public Object getStart_time() {
        return start_time;
    }

    public void setStart_time(Object start_time) {
        this.start_time = start_time;
    }

    public Object getEnd_time() {
        return end_time;
    }

    public void setEnd_time(Object end_time) {
        this.end_time = end_time;
    }

    public Object getCreate_date() {
        return create_date;
    }

    public void setCreate_date(Object create_date) {
        this.create_date = create_date;
    }

    public int getLike_num() {
        return Math.max(like_num, 0);
    }

    public int getLikeNum(boolean isLike) {
        int likeNum = getLike_num() + (isLike ? 1 : -1);
        setLike_num(likeNum);
        return Math.max(likeNum, 0);
    }

    public void setLike_num(int like_num) {
        this.like_num = like_num;
    }

    public int getDeny_num() {
        if (deny_num < 0) {
            return 0;
        }
        return deny_num;
    }

    public void setDeny_num(int deny_num) {
        this.deny_num = deny_num;
    }

    public String getRelease_time() {
        return release_time;
    }

    public void setRelease_time(String release_time) {
        this.release_time = release_time;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public int getIs_like() {
        return is_like;
    }

    public void setIs_like(int is_like) {
        this.is_like = is_like;
    }

    public int getIs_deny() {
        return is_deny;
    }

    public void setIs_deny(int is_deny) {
        this.is_deny = is_deny;
    }

    public int getRelease_time_stamp() {
        return release_time_stamp;
    }

    public void setRelease_time_stamp(int release_time_stamp) {
        this.release_time_stamp = release_time_stamp;
    }

    public Author getAuthor() {
        if (author == null) {
            return new Author();
        }
        return author;
    }

    public void setAuthor(Author author) {
        this.author = author;
    }

    public List<LabelInfo> getLabel_info() {
        return label_info;
    }

    public void setLabel_info(List<LabelInfo> label_info) {
        this.label_info = label_info;
    }

    public static class Author {
        private int    id;
        private String mobile;
        private String nickname;
        private String avatar_img;
        private int    type;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getMobile() {
            return mobile;
        }

        public void setMobile(String mobile) {
            this.mobile = mobile;
        }

        public String getNickname() {
            if (nickname == null) {
                return "null";
            }
            return nickname;
        }

        public void setNickname(String nickname) {
            this.nickname = nickname;
        }

        public String getAvatar_img() {
            return avatar_img;
        }

        public void setAvatar_img(String avatar_img) {
            this.avatar_img = avatar_img;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }
    }

    public static class LabelInfo {
        private int    id;
        private String name;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public static class SpecialInfo {
        private int    id;
        private String name;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
}
